package com.meilai.project.constant;

import lombok.Getter;

@Getter
public enum WorkOrderExecuteStatusEnum {
    UNEXECUTE(1, "未执行"),
    EXECUTING(2, "执行中"),
    EXPIRE(3, "已过期"),
    COMPLETE(4, "已完成"),
    CLOSE(5, "手动关闭");

    private Integer id;
    private String name;


    WorkOrderExecuteStatusEnum(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public static WorkOrderExecuteStatusEnum getEnumById(Integer id) {
        for (WorkOrderExecuteStatusEnum cur : WorkOrderExecuteStatusEnum.values()) {
            if (cur.getId().equals(id)) {
                return cur;
            }
        }
        return null;
    }
}
